import service from "../request/myService";

// 购物车列表
export const getGoodsCartListApi = (params) => service.get("/api/shopcart/list", { params })

// 加入购物车（数量加一）
// export const addGoodsToCartApi = (data) => service.post('/api/shopcart/add', { data })
export const addGoodsToCartApi = (data) => {
    return service({
        url: "/api/shopcart/add",
        method: "post",
        data
    })
}

// 购物车（数量减一）
// export const addGoodsToCartApi = (data) => service.post('/api/shopcart/add', { data })
export const subGoodsToCartApi = (data) => {
    return service({
        url: "/api/shopcart/sub",
        method: "post",
        data
    })
}

// 清空购物车
export const clearGoodsToCartApi = (data) => {
    return service({
        url: "/api/shopcart/clear",
        method: "post",
        data
    })
}